package logic

import (
	"context"
	"user_srv/internal/dao"

	"user_srv/internal/svc"
	"user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type ExpressOpinionsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewExpressOpinionsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ExpressOpinionsLogic {
	return &ExpressOpinionsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ExpressOpinionsLogic) ExpressOpinions(in *user.ExpressOpinionsRequest) (*user.ExpressOpinionsResponse, error) {
	// todo: add your logic here and delete this line
	opinions, err := dao.ExpressOpinions(in)
	if err != nil {
		return nil, err
	}
	return &user.ExpressOpinionsResponse{
		Id: int64(opinions.Id),
	}, nil
}
